# coding: UTF-8
"""
@作者 = "陈诗"
@email = 3168157154@qq.com
@creative_time = 2025/11/13 12:35
"""


class Employee:
    # 类属性,都可以调用
    company_name = "TechCorp"
    total_employees = 0  # 初始数量
    employees = []  # 储存名字

    def __init__(self, name, salary):
        self.name = name
        self.salary = salary

    @classmethod  # 引入cls,代替self
    def get_company_info(cls):
        print(f"公司名称:{cls.company_name} 员工总数:{cls.total_employees}")

    @classmethod
    def hire_employee(cls, name, salary):
        cls.employees.append(name)
        return salary

    @classmethod
    def get_all_employees(cls):
        print(f"员工姓名列表:{cls.employees}")
        return

    @classmethod
    def change_company_name(cls, new_name):
        cls.company_name = new_name


# 测试!
Employee.get_company_info()

Employee.hire_employee('张三', 8000)
Employee.hire_employee('李四', 9000)

Employee.get_company_info()
print(Employee.get_all_employees())

Employee.change_company_name('AdvancedTech')
print(Employee.get_company_info())
